{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "data": {
      "text/plain": "DatetimeIndex(['2019-01-01 01:02:03', '2019-01-13 01:26:39',\n               '2019-01-25 01:51:15', '2019-02-06 02:15:51',\n               '2019-02-18 02:40:27', '2019-03-02 03:05:03',\n               '2019-03-14 03:29:39', '2019-03-26 03:54:15',\n               '2019-04-07 04:18:51', '2019-04-19 04:43:27',\n               '2019-05-01 05:08:03', '2019-05-13 05:32:39',\n               '2019-05-25 05:57:15', '2019-06-06 06:21:51',\n               '2019-06-18 06:46:27', '2019-06-30 07:11:03',\n               '2019-07-12 07:35:39', '2019-07-24 08:00:15',\n               '2019-08-05 08:24:51', '2019-08-17 08:49:27',\n               '2019-08-29 09:14:03', '2019-09-10 09:38:39',\n               '2019-09-22 10:03:15', '2019-10-04 10:27:51',\n               '2019-10-16 10:52:27', '2019-10-28 11:17:03',\n               '2019-11-09 11:41:39', '2019-11-21 12:06:15',\n               '2019-12-03 12:30:51', '2019-12-15 12:55:27',\n               '2019-12-27 13:20:03', '2020-01-08 13:44:39',\n               '2020-01-20 14:09:15', '2020-02-01 14:33:51',\n               '2020-02-13 14:58:27', '2020-02-25 15:23:03',\n               '2020-03-08 15:47:39', '2020-03-20 16:12:15',\n               '2020-04-01 16:36:51', '2020-04-13 17:01:27',\n               '2020-04-25 17:26:03', '2020-05-07 17:50:39',\n               '2020-05-19 18:15:15', '2020-05-31 18:39:51',\n               '2020-06-12 19:04:27', '2020-06-24 19:29:03',\n               '2020-07-06 19:53:39', '2020-07-18 20:18:15',\n               '2020-07-30 20:42:51', '2020-08-11 21:07:27',\n               '2020-08-23 21:32:03', '2020-09-04 21:56:39',\n               '2020-09-16 22:21:15', '2020-09-28 22:45:51',\n               '2020-10-10 23:10:27', '2020-10-22 23:35:03',\n               '2020-11-03 23:59:39', '2020-11-16 00:24:15',\n               '2020-11-28 00:48:51', '2020-12-10 01:13:27',\n               '2020-12-22 01:38:03'],\n              dtype='datetime64[ns]', freq='1038276S')"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index = pd.date_range(\n",
    "    start='2019-01-01 01:02:03',\n",
    "    end='2020-12-31',\n",
    "    freq='12D24T36S'\n",
    ")\n",
    "index"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "outputs": [
    {
     "data": {
      "text/plain": "array([ 0.15776195, -1.23183491, -0.32985875,  0.10713479, -0.44559217,\n        0.60851013,  0.38443882,  0.79981419,  0.08066598, -0.422889  ,\n       -0.86430695, -1.76843243, -0.51281476, -0.95158856, -0.37430806,\n        0.82792511,  0.38959702, -0.95939167, -1.07524686,  1.54151341,\n        0.10582614, -0.83502651, -1.17306188,  0.0663889 , -1.33725965,\n        1.92341314, -0.02076757,  1.54448067,  1.81138191,  1.21893525,\n       -1.03607196,  0.36768315,  0.50070829,  1.78684154, -0.08470094,\n       -0.04731497,  0.83558638, -1.34241952,  1.60442713,  0.50974903,\n       -0.77940634, -0.37419235, -0.01465988,  1.45332507,  0.10444449,\n        1.12039965,  0.08949592, -1.24346167, -1.23100719,  1.43942662,\n        2.80823392, -1.48561432, -1.4668784 , -0.41657158, -0.35133838,\n        0.57218634,  0.23378623, -0.40124802,  0.57735179,  0.75325257,\n        1.35946126])"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.random.randn(len(index))\n",
    "data"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2019-01-01 01:02:03  0.157762\n2019-01-13 01:26:39 -1.231835\n2019-01-25 01:51:15 -0.329859\n2019-02-06 02:15:51  0.107135\n2019-02-18 02:40:27 -0.445592\n...                       ...\n2020-11-03 23:59:39  0.233786\n2020-11-16 00:24:15 -0.401248\n2020-11-28 00:48:51  0.577352\n2020-12-10 01:13:27  0.753253\n2020-12-22 01:38:03  1.359461\n\n[61 rows x 1 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2019-01-01 01:02:03</th>\n      <td>0.157762</td>\n    </tr>\n    <tr>\n      <th>2019-01-13 01:26:39</th>\n      <td>-1.231835</td>\n    </tr>\n    <tr>\n      <th>2019-01-25 01:51:15</th>\n      <td>-0.329859</td>\n    </tr>\n    <tr>\n      <th>2019-02-06 02:15:51</th>\n      <td>0.107135</td>\n    </tr>\n    <tr>\n      <th>2019-02-18 02:40:27</th>\n      <td>-0.445592</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2020-11-03 23:59:39</th>\n      <td>0.233786</td>\n    </tr>\n    <tr>\n      <th>2020-11-16 00:24:15</th>\n      <td>-0.401248</td>\n    </tr>\n    <tr>\n      <th>2020-11-28 00:48:51</th>\n      <td>0.577352</td>\n    </tr>\n    <tr>\n      <th>2020-12-10 01:13:27</th>\n      <td>0.753253</td>\n    </tr>\n    <tr>\n      <th>2020-12-22 01:38:03</th>\n      <td>1.359461</td>\n    </tr>\n  </tbody>\n</table>\n<p>61 rows × 1 columns</p>\n</div>"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(\n",
    "    data, index\n",
    ")\n",
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2019-01-01 01:02:03  0.157762\n2019-01-13 01:26:39 -1.231835\n2019-01-25 01:51:15 -0.329859\n2019-02-06 02:15:51  0.107135\n2019-02-18 02:40:27 -0.445592\n2019-03-02 03:05:03  0.608510\n2019-03-14 03:29:39  0.384439\n2019-03-26 03:54:15  0.799814\n2019-04-07 04:18:51  0.080666\n2019-04-19 04:43:27 -0.422889\n2019-05-01 05:08:03 -0.864307\n2019-05-13 05:32:39 -1.768432\n2019-05-25 05:57:15 -0.512815\n2019-06-06 06:21:51 -0.951589\n2019-06-18 06:46:27 -0.374308\n2019-06-30 07:11:03  0.827925\n2019-07-12 07:35:39  0.389597\n2019-07-24 08:00:15 -0.959392\n2019-08-05 08:24:51 -1.075247\n2019-08-17 08:49:27  1.541513\n2019-08-29 09:14:03  0.105826\n2019-09-10 09:38:39 -0.835027\n2019-09-22 10:03:15 -1.173062\n2019-10-04 10:27:51  0.066389\n2019-10-16 10:52:27 -1.337260\n2019-10-28 11:17:03  1.923413\n2019-11-09 11:41:39 -0.020768\n2019-11-21 12:06:15  1.544481\n2019-12-03 12:30:51  1.811382\n2019-12-15 12:55:27  1.218935\n2019-12-27 13:20:03 -1.036072",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2019-01-01 01:02:03</th>\n      <td>0.157762</td>\n    </tr>\n    <tr>\n      <th>2019-01-13 01:26:39</th>\n      <td>-1.231835</td>\n    </tr>\n    <tr>\n      <th>2019-01-25 01:51:15</th>\n      <td>-0.329859</td>\n    </tr>\n    <tr>\n      <th>2019-02-06 02:15:51</th>\n      <td>0.107135</td>\n    </tr>\n    <tr>\n      <th>2019-02-18 02:40:27</th>\n      <td>-0.445592</td>\n    </tr>\n    <tr>\n      <th>2019-03-02 03:05:03</th>\n      <td>0.608510</td>\n    </tr>\n    <tr>\n      <th>2019-03-14 03:29:39</th>\n      <td>0.384439</td>\n    </tr>\n    <tr>\n      <th>2019-03-26 03:54:15</th>\n      <td>0.799814</td>\n    </tr>\n    <tr>\n      <th>2019-04-07 04:18:51</th>\n      <td>0.080666</td>\n    </tr>\n    <tr>\n      <th>2019-04-19 04:43:27</th>\n      <td>-0.422889</td>\n    </tr>\n    <tr>\n      <th>2019-05-01 05:08:03</th>\n      <td>-0.864307</td>\n    </tr>\n    <tr>\n      <th>2019-05-13 05:32:39</th>\n      <td>-1.768432</td>\n    </tr>\n    <tr>\n      <th>2019-05-25 05:57:15</th>\n      <td>-0.512815</td>\n    </tr>\n    <tr>\n      <th>2019-06-06 06:21:51</th>\n      <td>-0.951589</td>\n    </tr>\n    <tr>\n      <th>2019-06-18 06:46:27</th>\n      <td>-0.374308</td>\n    </tr>\n    <tr>\n      <th>2019-06-30 07:11:03</th>\n      <td>0.827925</td>\n    </tr>\n    <tr>\n      <th>2019-07-12 07:35:39</th>\n      <td>0.389597</td>\n    </tr>\n    <tr>\n      <th>2019-07-24 08:00:15</th>\n      <td>-0.959392</td>\n    </tr>\n    <tr>\n      <th>2019-08-05 08:24:51</th>\n      <td>-1.075247</td>\n    </tr>\n    <tr>\n      <th>2019-08-17 08:49:27</th>\n      <td>1.541513</td>\n    </tr>\n    <tr>\n      <th>2019-08-29 09:14:03</th>\n      <td>0.105826</td>\n    </tr>\n    <tr>\n      <th>2019-09-10 09:38:39</th>\n      <td>-0.835027</td>\n    </tr>\n    <tr>\n      <th>2019-09-22 10:03:15</th>\n      <td>-1.173062</td>\n    </tr>\n    <tr>\n      <th>2019-10-04 10:27:51</th>\n      <td>0.066389</td>\n    </tr>\n    <tr>\n      <th>2019-10-16 10:52:27</th>\n      <td>-1.337260</td>\n    </tr>\n    <tr>\n      <th>2019-10-28 11:17:03</th>\n      <td>1.923413</td>\n    </tr>\n    <tr>\n      <th>2019-11-09 11:41:39</th>\n      <td>-0.020768</td>\n    </tr>\n    <tr>\n      <th>2019-11-21 12:06:15</th>\n      <td>1.544481</td>\n    </tr>\n    <tr>\n      <th>2019-12-03 12:30:51</th>\n      <td>1.811382</td>\n    </tr>\n    <tr>\n      <th>2019-12-15 12:55:27</th>\n      <td>1.218935</td>\n    </tr>\n    <tr>\n      <th>2019-12-27 13:20:03</th>\n      <td>-1.036072</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2019']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2020-01-08 13:44:39  0.367683\n2020-01-20 14:09:15  0.500708\n2020-02-01 14:33:51  1.786842\n2020-02-13 14:58:27 -0.084701\n2020-02-25 15:23:03 -0.047315\n2020-03-08 15:47:39  0.835586\n2020-03-20 16:12:15 -1.342420\n2020-04-01 16:36:51  1.604427\n2020-04-13 17:01:27  0.509749\n2020-04-25 17:26:03 -0.779406\n2020-05-07 17:50:39 -0.374192\n2020-05-19 18:15:15 -0.014660\n2020-05-31 18:39:51  1.453325\n2020-06-12 19:04:27  0.104444\n2020-06-24 19:29:03  1.120400\n2020-07-06 19:53:39  0.089496\n2020-07-18 20:18:15 -1.243462\n2020-07-30 20:42:51 -1.231007\n2020-08-11 21:07:27  1.439427\n2020-08-23 21:32:03  2.808234\n2020-09-04 21:56:39 -1.485614\n2020-09-16 22:21:15 -1.466878\n2020-09-28 22:45:51 -0.416572\n2020-10-10 23:10:27 -0.351338\n2020-10-22 23:35:03  0.572186\n2020-11-03 23:59:39  0.233786\n2020-11-16 00:24:15 -0.401248\n2020-11-28 00:48:51  0.577352\n2020-12-10 01:13:27  0.753253\n2020-12-22 01:38:03  1.359461",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2020-01-08 13:44:39</th>\n      <td>0.367683</td>\n    </tr>\n    <tr>\n      <th>2020-01-20 14:09:15</th>\n      <td>0.500708</td>\n    </tr>\n    <tr>\n      <th>2020-02-01 14:33:51</th>\n      <td>1.786842</td>\n    </tr>\n    <tr>\n      <th>2020-02-13 14:58:27</th>\n      <td>-0.084701</td>\n    </tr>\n    <tr>\n      <th>2020-02-25 15:23:03</th>\n      <td>-0.047315</td>\n    </tr>\n    <tr>\n      <th>2020-03-08 15:47:39</th>\n      <td>0.835586</td>\n    </tr>\n    <tr>\n      <th>2020-03-20 16:12:15</th>\n      <td>-1.342420</td>\n    </tr>\n    <tr>\n      <th>2020-04-01 16:36:51</th>\n      <td>1.604427</td>\n    </tr>\n    <tr>\n      <th>2020-04-13 17:01:27</th>\n      <td>0.509749</td>\n    </tr>\n    <tr>\n      <th>2020-04-25 17:26:03</th>\n      <td>-0.779406</td>\n    </tr>\n    <tr>\n      <th>2020-05-07 17:50:39</th>\n      <td>-0.374192</td>\n    </tr>\n    <tr>\n      <th>2020-05-19 18:15:15</th>\n      <td>-0.014660</td>\n    </tr>\n    <tr>\n      <th>2020-05-31 18:39:51</th>\n      <td>1.453325</td>\n    </tr>\n    <tr>\n      <th>2020-06-12 19:04:27</th>\n      <td>0.104444</td>\n    </tr>\n    <tr>\n      <th>2020-06-24 19:29:03</th>\n      <td>1.120400</td>\n    </tr>\n    <tr>\n      <th>2020-07-06 19:53:39</th>\n      <td>0.089496</td>\n    </tr>\n    <tr>\n      <th>2020-07-18 20:18:15</th>\n      <td>-1.243462</td>\n    </tr>\n    <tr>\n      <th>2020-07-30 20:42:51</th>\n      <td>-1.231007</td>\n    </tr>\n    <tr>\n      <th>2020-08-11 21:07:27</th>\n      <td>1.439427</td>\n    </tr>\n    <tr>\n      <th>2020-08-23 21:32:03</th>\n      <td>2.808234</td>\n    </tr>\n    <tr>\n      <th>2020-09-04 21:56:39</th>\n      <td>-1.485614</td>\n    </tr>\n    <tr>\n      <th>2020-09-16 22:21:15</th>\n      <td>-1.466878</td>\n    </tr>\n    <tr>\n      <th>2020-09-28 22:45:51</th>\n      <td>-0.416572</td>\n    </tr>\n    <tr>\n      <th>2020-10-10 23:10:27</th>\n      <td>-0.351338</td>\n    </tr>\n    <tr>\n      <th>2020-10-22 23:35:03</th>\n      <td>0.572186</td>\n    </tr>\n    <tr>\n      <th>2020-11-03 23:59:39</th>\n      <td>0.233786</td>\n    </tr>\n    <tr>\n      <th>2020-11-16 00:24:15</th>\n      <td>-0.401248</td>\n    </tr>\n    <tr>\n      <th>2020-11-28 00:48:51</th>\n      <td>0.577352</td>\n    </tr>\n    <tr>\n      <th>2020-12-10 01:13:27</th>\n      <td>0.753253</td>\n    </tr>\n    <tr>\n      <th>2020-12-22 01:38:03</th>\n      <td>1.359461</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2020']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2020-05-07 17:50:39 -0.374192\n2020-05-19 18:15:15 -0.014660\n2020-05-31 18:39:51  1.453325",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2020-05-07 17:50:39</th>\n      <td>-0.374192</td>\n    </tr>\n    <tr>\n      <th>2020-05-19 18:15:15</th>\n      <td>-0.014660</td>\n    </tr>\n    <tr>\n      <th>2020-05-31 18:39:51</th>\n      <td>1.453325</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2020-05']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2020-05-07 17:50:39 -0.374192",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2020-05-07 17:50:39</th>\n      <td>-0.374192</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2020-05-07']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2020-05-07 17:50:39 -0.374192\n2020-05-19 18:15:15 -0.014660\n2020-05-31 18:39:51  1.453325\n2020-06-12 19:04:27  0.104444\n2020-06-24 19:29:03  1.120400\n2020-07-06 19:53:39  0.089496\n2020-07-18 20:18:15 -1.243462\n2020-07-30 20:42:51 -1.231007\n2020-08-11 21:07:27  1.439427\n2020-08-23 21:32:03  2.808234\n2020-09-04 21:56:39 -1.485614\n2020-09-16 22:21:15 -1.466878\n2020-09-28 22:45:51 -0.416572\n2020-10-10 23:10:27 -0.351338\n2020-10-22 23:35:03  0.572186\n2020-11-03 23:59:39  0.233786\n2020-11-16 00:24:15 -0.401248\n2020-11-28 00:48:51  0.577352\n2020-12-10 01:13:27  0.753253\n2020-12-22 01:38:03  1.359461",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2020-05-07 17:50:39</th>\n      <td>-0.374192</td>\n    </tr>\n    <tr>\n      <th>2020-05-19 18:15:15</th>\n      <td>-0.014660</td>\n    </tr>\n    <tr>\n      <th>2020-05-31 18:39:51</th>\n      <td>1.453325</td>\n    </tr>\n    <tr>\n      <th>2020-06-12 19:04:27</th>\n      <td>0.104444</td>\n    </tr>\n    <tr>\n      <th>2020-06-24 19:29:03</th>\n      <td>1.120400</td>\n    </tr>\n    <tr>\n      <th>2020-07-06 19:53:39</th>\n      <td>0.089496</td>\n    </tr>\n    <tr>\n      <th>2020-07-18 20:18:15</th>\n      <td>-1.243462</td>\n    </tr>\n    <tr>\n      <th>2020-07-30 20:42:51</th>\n      <td>-1.231007</td>\n    </tr>\n    <tr>\n      <th>2020-08-11 21:07:27</th>\n      <td>1.439427</td>\n    </tr>\n    <tr>\n      <th>2020-08-23 21:32:03</th>\n      <td>2.808234</td>\n    </tr>\n    <tr>\n      <th>2020-09-04 21:56:39</th>\n      <td>-1.485614</td>\n    </tr>\n    <tr>\n      <th>2020-09-16 22:21:15</th>\n      <td>-1.466878</td>\n    </tr>\n    <tr>\n      <th>2020-09-28 22:45:51</th>\n      <td>-0.416572</td>\n    </tr>\n    <tr>\n      <th>2020-10-10 23:10:27</th>\n      <td>-0.351338</td>\n    </tr>\n    <tr>\n      <th>2020-10-22 23:35:03</th>\n      <td>0.572186</td>\n    </tr>\n    <tr>\n      <th>2020-11-03 23:59:39</th>\n      <td>0.233786</td>\n    </tr>\n    <tr>\n      <th>2020-11-16 00:24:15</th>\n      <td>-0.401248</td>\n    </tr>\n    <tr>\n      <th>2020-11-28 00:48:51</th>\n      <td>0.577352</td>\n    </tr>\n    <tr>\n      <th>2020-12-10 01:13:27</th>\n      <td>0.753253</td>\n    </tr>\n    <tr>\n      <th>2020-12-22 01:38:03</th>\n      <td>1.359461</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2020-05-07 17:50:39':]"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [
    {
     "data": {
      "text/plain": "                            0\n2019-05-01 05:08:03 -0.864307\n2019-05-13 05:32:39 -1.768432\n2019-05-25 05:57:15 -0.512815\n2019-06-06 06:21:51 -0.951589\n2019-06-18 06:46:27 -0.374308\n2019-06-30 07:11:03  0.827925\n2019-07-12 07:35:39  0.389597\n2019-07-24 08:00:15 -0.959392\n2019-08-05 08:24:51 -1.075247\n2019-08-17 08:49:27  1.541513\n2019-08-29 09:14:03  0.105826\n2019-09-10 09:38:39 -0.835027\n2019-09-22 10:03:15 -1.173062\n2019-10-04 10:27:51  0.066389\n2019-10-16 10:52:27 -1.337260\n2019-10-28 11:17:03  1.923413\n2019-11-09 11:41:39 -0.020768\n2019-11-21 12:06:15  1.544481\n2019-12-03 12:30:51  1.811382\n2019-12-15 12:55:27  1.218935\n2019-12-27 13:20:03 -1.036072\n2020-01-08 13:44:39  0.367683\n2020-01-20 14:09:15  0.500708\n2020-02-01 14:33:51  1.786842\n2020-02-13 14:58:27 -0.084701\n2020-02-25 15:23:03 -0.047315\n2020-03-08 15:47:39  0.835586\n2020-03-20 16:12:15 -1.342420\n2020-04-01 16:36:51  1.604427\n2020-04-13 17:01:27  0.509749\n2020-04-25 17:26:03 -0.779406\n2020-05-07 17:50:39 -0.374192\n2020-05-19 18:15:15 -0.014660",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>0</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2019-05-01 05:08:03</th>\n      <td>-0.864307</td>\n    </tr>\n    <tr>\n      <th>2019-05-13 05:32:39</th>\n      <td>-1.768432</td>\n    </tr>\n    <tr>\n      <th>2019-05-25 05:57:15</th>\n      <td>-0.512815</td>\n    </tr>\n    <tr>\n      <th>2019-06-06 06:21:51</th>\n      <td>-0.951589</td>\n    </tr>\n    <tr>\n      <th>2019-06-18 06:46:27</th>\n      <td>-0.374308</td>\n    </tr>\n    <tr>\n      <th>2019-06-30 07:11:03</th>\n      <td>0.827925</td>\n    </tr>\n    <tr>\n      <th>2019-07-12 07:35:39</th>\n      <td>0.389597</td>\n    </tr>\n    <tr>\n      <th>2019-07-24 08:00:15</th>\n      <td>-0.959392</td>\n    </tr>\n    <tr>\n      <th>2019-08-05 08:24:51</th>\n      <td>-1.075247</td>\n    </tr>\n    <tr>\n      <th>2019-08-17 08:49:27</th>\n      <td>1.541513</td>\n    </tr>\n    <tr>\n      <th>2019-08-29 09:14:03</th>\n      <td>0.105826</td>\n    </tr>\n    <tr>\n      <th>2019-09-10 09:38:39</th>\n      <td>-0.835027</td>\n    </tr>\n    <tr>\n      <th>2019-09-22 10:03:15</th>\n      <td>-1.173062</td>\n    </tr>\n    <tr>\n      <th>2019-10-04 10:27:51</th>\n      <td>0.066389</td>\n    </tr>\n    <tr>\n      <th>2019-10-16 10:52:27</th>\n      <td>-1.337260</td>\n    </tr>\n    <tr>\n      <th>2019-10-28 11:17:03</th>\n      <td>1.923413</td>\n    </tr>\n    <tr>\n      <th>2019-11-09 11:41:39</th>\n      <td>-0.020768</td>\n    </tr>\n    <tr>\n      <th>2019-11-21 12:06:15</th>\n      <td>1.544481</td>\n    </tr>\n    <tr>\n      <th>2019-12-03 12:30:51</th>\n      <td>1.811382</td>\n    </tr>\n    <tr>\n      <th>2019-12-15 12:55:27</th>\n      <td>1.218935</td>\n    </tr>\n    <tr>\n      <th>2019-12-27 13:20:03</th>\n      <td>-1.036072</td>\n    </tr>\n    <tr>\n      <th>2020-01-08 13:44:39</th>\n      <td>0.367683</td>\n    </tr>\n    <tr>\n      <th>2020-01-20 14:09:15</th>\n      <td>0.500708</td>\n    </tr>\n    <tr>\n      <th>2020-02-01 14:33:51</th>\n      <td>1.786842</td>\n    </tr>\n    <tr>\n      <th>2020-02-13 14:58:27</th>\n      <td>-0.084701</td>\n    </tr>\n    <tr>\n      <th>2020-02-25 15:23:03</th>\n      <td>-0.047315</td>\n    </tr>\n    <tr>\n      <th>2020-03-08 15:47:39</th>\n      <td>0.835586</td>\n    </tr>\n    <tr>\n      <th>2020-03-20 16:12:15</th>\n      <td>-1.342420</td>\n    </tr>\n    <tr>\n      <th>2020-04-01 16:36:51</th>\n      <td>1.604427</td>\n    </tr>\n    <tr>\n      <th>2020-04-13 17:01:27</th>\n      <td>0.509749</td>\n    </tr>\n    <tr>\n      <th>2020-04-25 17:26:03</th>\n      <td>-0.779406</td>\n    </tr>\n    <tr>\n      <th>2020-05-07 17:50:39</th>\n      <td>-0.374192</td>\n    </tr>\n    <tr>\n      <th>2020-05-19 18:15:15</th>\n      <td>-0.014660</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2019-05':'2020-05-19']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [],
   "source": [
    "df.columns = ['2020-05']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [
    {
     "data": {
      "text/plain": "                      2020-05\n2019-01-01 01:02:03  0.157762\n2019-01-13 01:26:39 -1.231835\n2019-01-25 01:51:15 -0.329859\n2019-02-06 02:15:51  0.107135\n2019-02-18 02:40:27 -0.445592\n...                       ...\n2020-11-03 23:59:39  0.233786\n2020-11-16 00:24:15 -0.401248\n2020-11-28 00:48:51  0.577352\n2020-12-10 01:13:27  0.753253\n2020-12-22 01:38:03  1.359461\n\n[61 rows x 1 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>2020-05</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2019-01-01 01:02:03</th>\n      <td>0.157762</td>\n    </tr>\n    <tr>\n      <th>2019-01-13 01:26:39</th>\n      <td>-1.231835</td>\n    </tr>\n    <tr>\n      <th>2019-01-25 01:51:15</th>\n      <td>-0.329859</td>\n    </tr>\n    <tr>\n      <th>2019-02-06 02:15:51</th>\n      <td>0.107135</td>\n    </tr>\n    <tr>\n      <th>2019-02-18 02:40:27</th>\n      <td>-0.445592</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>2020-11-03 23:59:39</th>\n      <td>0.233786</td>\n    </tr>\n    <tr>\n      <th>2020-11-16 00:24:15</th>\n      <td>-0.401248</td>\n    </tr>\n    <tr>\n      <th>2020-11-28 00:48:51</th>\n      <td>0.577352</td>\n    </tr>\n    <tr>\n      <th>2020-12-10 01:13:27</th>\n      <td>0.753253</td>\n    </tr>\n    <tr>\n      <th>2020-12-22 01:38:03</th>\n      <td>1.359461</td>\n    </tr>\n  </tbody>\n</table>\n<p>61 rows × 1 columns</p>\n</div>"
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [
    {
     "data": {
      "text/plain": "2019-01-01 01:02:03    0.157762\n2019-01-13 01:26:39   -1.231835\n2019-01-25 01:51:15   -0.329859\n2019-02-06 02:15:51    0.107135\n2019-02-18 02:40:27   -0.445592\n                         ...   \n2020-11-03 23:59:39    0.233786\n2020-11-16 00:24:15   -0.401248\n2020-11-28 00:48:51    0.577352\n2020-12-10 01:13:27    0.753253\n2020-12-22 01:38:03    1.359461\nFreq: 1038276S, Name: 2020-05, Length: 61, dtype: float64"
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['2020-05']"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}